package StudyCode.summary.myfile;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ConvertSerializedByteArrayToObject {

	public static Object toObject(byte[] bytes) {
		try {
			Object object = null;
			object = new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject();
			return object;
		} catch (IOException ex) {
			ex.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}
}
